package net.hubbery.service;


import net.hubbery.bean.Bill;
import net.hubbery.dao.BillDao;

import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.List;

public class Orderservice {

    public boolean createOrder(Bill bill) throws SQLException {
        BillDao billDao = new BillDao();
        boolean checkRoom = billDao.checkRoom(bill.getRoomId());
        if (checkRoom) {
            boolean create = billDao.createBill(bill);
            if (create) {
                return true;
            }else {
                return false;
            }
        } else {
            return false;
        }
    }


    public List<Bill> getBills() throws SQLException {
        BillDao billDao = new BillDao();
        List<Bill> bills = billDao.getBills();
        return bills;
    }
}
